package com.edu.atams.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * <p>
 *
 * </p>
 *
 * @author czj666
 * @since 2021-10-09
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class Voting extends BaseEntity {

    private static final long serialVersionUID = 1L;

    private String title;

    private String content;

    private Integer isMultiple;

    private Integer isAnonymous;

    private Integer publisherId;

    // 用于展示发布人姓名
    @TableField(exist = false)
    private String publisherName;

    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm")
    private Date createTime;

    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm")
    private Date endTime;

    // 不知道是只发送一个班级而已，还是可以选择多个班级进行发送，看图是点击班级后才发送投票，如果是单个，直接改变表结构，在问卷投票记录中保存单个班级id即可
    // 目前这里是留了可以选择多个班级勾选，进行的保存问卷投票id和班级id的关联
    @TableField(exist = false)
    private List<Class> classes;

    @TableField(exist = false)
    private List<VotingOption> votingOptions;

    @TableField(exist = false)
    private List<VotingPhoto> votingPhotos = new ArrayList<>();


}
